home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-05-20 | 1.6 KB | 60 lines | [TEXT/????] |
- Instead of putting preferences files in the preferences folder, I set their
- invisible bits. I used to do this with DiskTop, but my version doesn't seem
- to work any more (yes, it's a legal copy, but old). I can do it with ResEdit,
- but it's too slow.
-
- I was intrigued by the way that you can drop stuff into ResEdit, so I wrote
- a short application that hides any files that you drop into it. Take it just
- as a weird hack, I haven't tested this thing properly.
-
- In Think C, the thing looks like:
-
- /*
- >> Obfuscator.c This program hides all the files that are given to it.
- >>
- >> Copyright 1991, Juri Munkki
- >> Feel free to use the code in your programs.
- */
-
- void ReadFinderStuff()
- {
- int message,count,i;
- AppFile thefile;
- FileParam block;
-
- CountAppFiles(&message,&count);
- if(message==1)
- { return;
- }
- else
- { for(i=1;i<=count;i++)
- { GetAppFiles(i,&thefile);
-
- block.ioCompletion=0;
- block.ioNamePtr=thefile.fName;
- block.ioVRefNum=thefile.vRefNum;
- block.ioFVersNum=thefile.versNum;
- block.ioFDirIndex=0;
-
- PBGetFInfo(&block,0);
- block.ioFlFndrInfo.fdFlags |= fInvisible;
- PBSetFInfo(&block,0);
- }
- }
- }
-
- void main()
- {
- InitGraf(&thePort);
- InitCursor();
- ReadFinderStuff();
- }
-
- Of course, you can't get the files back with the same program, but that's
- a minor problem... ____________________________________________________________________________
- / Juri Munkki / Helsinki University of Technology / Wind / Project/
- / jmunkki@hut.fi / Computing Center Macintosh Support / Surf / STORM /
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
-